<?php
/**
 * Created by PhpStorm.
 * User: zhangyufeng
 * Date: 15/5/15
 * Time: 下午7:03
 */

namespace app\models;

use Yii;
use yii\db\ActiveRecord;

class Account extends ActiveRecord
{
    public static function tableName()
    {
        return 'account';
    }

    public static function findByNumber($num){
        $account = Account::find()->where(['number'=>$num])->one();
        if(!empty($account)){
            return $account;
        }
        return null;
    }
}